home *** CD-ROM | disk | FTP | other *** search
/ AmigActive 10 / AACD 10.iso / CDTools / MUIRexx / demos / demo.rexx < prev    next >
OS/2 REXX Batch file  |  1997-04-21  |  14KB  |  278 lines

  1. /* */
  2. options results
  3.  
  4. /* Method TAG ID definitions */
  5.  
  6. MUIM_Notify = 0x8042c9cb
  7. MUIM_Set = 0x8042549a
  8. MUIM_NoNotifySet = 0x8042216f
  9. MUIM_Application_AboutMUI = 0x8042d21d
  10. MUIM_Application_OpenConfigWindow = 0x804299ba
  11.  
  12. /* Attribute TAG ID definitions */
  13.  
  14. MUIA_AppMessage =                      0x80421955 /* V5  ..g struct AppMessage * */
  15. MUIA_Dropable =                        0x8042fbce /* V11 isg BOOL              */
  16. MUIA_Draggable = 0x80420b6e
  17. MUIA_Listview_DragType = 0x80425cd3
  18. MUIA_List_Format =                     0x80423c0a /* V4  isg STRPTR            */
  19. MUIA_FillArea =                        0x804294a3 /* V4  is. BOOL              */
  20. MUIA_Frame =                           0x8042ac64 /* V4  i.. LONG              */
  21. MUIA_Weight =                          0x80421d1f /* V4  i.. WORD              */
  22. MUIA_Gauge_Current =                   0x8042f0dd /* V4  isg LONG              */
  23. MUIA_Gauge_Divide =                    0x8042d8df /* V4  isg BOOL              */
  24. MUIA_Gauge_Horiz =                     0x804232dd /* V4  i.. BOOL              */
  25. MUIA_Gauge_Max =                       0x8042bcdb /* V4  isg LONG              */
  26. MUIA_Numeric_Value = 0x8042ae3a
  27. MUIA_Menuitem_Title = 0x804218be
  28. MUIA_Menuitem_Shortcut =               0x80422030 /* V8  isg STRPTR            */
  29. MUIA_Boopsi_MinHeight =                0x80422c93 /* V4  isg ULONG             */
  30. MUIA_Boopsi_MinWidth =                 0x80428fb2 /* V4  isg ULONG             */
  31. MUIA_Boopsi_Remember =                 0x8042f4bd /* V4  i.. ULONG             */
  32. MUIA_Boopsi_TagScreen =                0x8042bc71 /* V4  isg ULONG             */
  33. WHEEL_Hue =                            0x84000001
  34. WHEEL_Saturation =                     0x84000002
  35. WHEEL_Screen =                         0x84000009
  36.  
  37. /* TAG variable definitions */
  38.  
  39. TRUE = 1
  40. FALSE = 0
  41. MUIV_Listview_DragType_None = 0
  42. MUIV_Listview_DragType_Immediate = 1
  43. MUIV_Frame_None = 0
  44. MUIV_Frame_Text = 3
  45. MUIV_TriggerValue = 0x49893131
  46. MUIV_EveryTime = 0x49893131
  47.  
  48. address DEMO
  49.  
  50. window ID WDEMO TITLE '"MUIRexx Demo"' COMMAND '"quit"' PORT DEMO
  51.     menu LABEL "Project"
  52.         item COMMAND '"method 'MUIM_Application_AboutMUI' 0"' PORT DEMO LABEL "About MUI"
  53.         menu LABEL "Settings"
  54.             item COMMAND '"method 'MUIM_Application_OpenConfigWindow'"' PORT DEMO LABEL "MUI..."
  55.         endmenu
  56.         item ATTRS MUIA_Menuitem_Title '-1'
  57.         item COMMAND '"quit"' PORT DEMO ATTRS MUIA_Menuitem_Shortcut 'Q' LABEL "Quit"
  58.     endmenu
  59.     text LABEL 'A demonstration of MUIRexx'
  60.     group REGISTER LABELS "Gadgets,Lists,Cycles,Icons,Strings,Boopsi"
  61.         group
  62.             menu LABEL "Demo"
  63.                 item COMMAND '"string ID STR CONTENT %s"' PORT DEMO LABEL "Menuitem 1"
  64.                 item COMMAND '"string ID STR CONTENT %s"' PORT DEMO LABEL "Menuitem 2"
  65.                 menu LABEL "Submenu"
  66.                     item COMMAND '"string ID STR CONTENT %s"' PORT DEMO LABEL "Submenuitem 1"
  67.                     item COMMAND '"string ID STR CONTENT %s"' PORT DEMO LABEL "Submenuitem 2"
  68.                 endmenu
  69.             endmenu
  70.             view ID GVIEW STRING "A simple demonstration of some of the gadgets available. 
  71. Most gadgets are internal to MUIRexx but others are built from internal and 
  72. external classes.  Notice that some gadgets are linked to others."
  73.             object CLASS '"Balance.mui"'
  74.             group HORIZ
  75.                 object ID GCLR CLASS '"Coloradjust.mui"'
  76.                 object CLASS '"Balance.mui"'
  77.                 group
  78.                     space
  79.                     group HORIZ
  80.                         space HORIZ
  81.                         group
  82.                             knob ID KNOB HELP '"an example knob gadget\012Press HELP for more info"' NODE '"knob"'
  83.                             popslider ID PSLD HELP '"an example popup slider gadget\nPress HELP for more info"' NODE '"popslider"'
  84.                         endgroup
  85.                         meter ID METR NODE '"meter"' LABEL "meter"
  86.                         space HORIZ
  87.                     endgroup
  88.                     slider ID SLDR HELP '"an example slider gadget\nPress HELP for more info"' NODE '"slider"'
  89.                     gauge ID GAUG NODE '"gauge"' ATTRS MUIA_Gauge_Horiz TRUE LABEL "level %ld"
  90.                     object CLASS '"Scale.mui"'
  91.                     space
  92.                 endgroup
  93.             endgroup
  94.             group FRAME HORIZ
  95.                 check COMMAND '"string ID STR CONTENT %s"' PORT DEMO NODE '"check"' LABEL "unselected,selected"
  96.                 text COMMAND '"string ID STR CONTENT %s"' PORT DEMO NODE '"text"' LABEL 'text'
  97.                 button COMMAND '"string ID STR CONTENT %s"' PORT DEMO NODE '"button"' LABEL 'button'
  98.                 image COMMAND '"string ID STR CONTENT %s"' PORT DEMO NODE '"image"' SPEC '"4:MUI:Images/WD/13pt/PopUp.mf0"' LABEL 'image'
  99.                 object CLASS '"Balance.mui"'
  100.                 string ID STR
  101.             endgroup
  102.             object CLASS '"Busy.mcc"' ATTRS MUIA_Weight 0
  103.         endgroup
  104.         group
  105.             view STRING "A demonstration of some lists available. Notice that the 
  106. volume list is linked to the directory list and the directory list is linked 
  107. to the string gadget. This view list is another example of a possible list. 
  108. Note that view lists are read-only."
  109.             group HORIZ
  110.                 group ATTRS MUIA_Weight 0
  111.                     button ID DF0 ATTRS MUIA_Draggable TRUE LABEL 'DF0:'
  112.                     button ID DH0 ATTRS MUIA_Draggable TRUE LABEL 'DH0:'
  113.                     button ID DH1 ATTRS MUIA_Draggable TRUE LABEL 'DH1:'
  114.                     button ID SYS ATTRS MUIA_Draggable TRUE LABEL 'SYS:'
  115.                     button ID RAM ATTRS MUIA_Draggable TRUE LABEL 'RAM:'
  116.                 endgroup
  117.                 dirlist ID DIR1 PATH '"ram:"',
  118.                     COMMAND '"dirlist ID DIR1 PATH %s"' PORT DEMO NODE '"dirlist"',
  119.                     ATTRS MUIA_Frame MUIV_Frame_Text MUIA_Listview_DragType MUIV_Listview_DragType_Immediate
  120.                 volumelist,
  121.                     COMMAND '"dirlist ID DIR1 PATH %s"' PORT DEMO NODE '"volumelist"',
  122.                     ATTRS MUIA_Weight 50
  123.                 group
  124.                     space
  125.                     button ID VIEW ICON '"muirexx:demos/icons/multiview"' NODE '"button"'
  126.                     space
  127.                 endgroup
  128.             endgroup
  129.             string ID FILE
  130.         endgroup
  131.         group
  132.             view STRING "A demonstration of cycle and radio gadgets. This page shows 
  133. some more examples of linked gadgets."
  134.             group HORIZ
  135.                 group FRAME LABEL "Computer:"
  136.                     radio ID RCMP,
  137.                         COMMAND '"cycle ID CCMP LABEL %s"' PORT DEMO NODE '"radio"',
  138.                         LABELS 'Amiga 500,Amiga 600,Amiga 1000,Amiga 1200,Amiga 2000,Amiga 3000,Amiga 4000,Amiga 4000T'
  139.                 endgroup
  140.                 group
  141.                     group FRAME LABEL "Printer:"
  142.                         radio ID RPRT,
  143.                             COMMAND '"cycle ID CPRT LABEL %s"' PORT DEMO NODE '"radio"',
  144.                             LABELS 'HP Deskjet,NEC P6,Okimate 20'
  145.                     endgroup
  146.                     group FRAME LABEL "Display:"
  147.                         radio ID RDSP,
  148.                             COMMAND '"cycle ID CDSP LABEL %s"' PORT DEMO NODE '"radio"',
  149.                             LABELS 'A1081,NEC 3D,A2024,Eizo T660i'
  150.                     endgroup
  151.                 endgroup
  152.                 group FRAME LABEL "Cycle Gadgets"
  153.                     group HORIZ
  154.                         group
  155.                             label "Computer:"
  156.                             label "Printer:"
  157.                             label "Display:"
  158.                         endgroup
  159.                         group
  160.                             cycle ID CCMP,
  161.                                 COMMAND '"radio ID RCMP LABEL %s"' PORT DEMO NODE '"cycle"',
  162.                                 LABELS 'Amiga 500,Amiga 600,Amiga 1000,Amiga 1200,Amiga 2000,Amiga 3000,Amiga 4000,Amiga 4000T'
  163.                             cycle ID CPRT,
  164.                                 COMMAND '"radio ID RPRT LABEL %s"' PORT DEMO NODE '"cycle"',
  165.                                 LABELS 'HP Deskjet,NEC P6,Okimate 20'
  166.                             cycle ID CDSP,
  167.                                 COMMAND '"radio ID RDSP LABEL %s"' PORT DEMO NODE '"cycle"',
  168.                                 LABELS 'A1081,NEC 3D,A2024,Eizo T660i'
  169.                         endgroup
  170.                     endgroup
  171.                 endgroup
  172.             endgroup
  173.         endgroup
  174.         group
  175.             view STRING "A demonstration of icon gadgets. Try clicking on the icons 
  176. below. Also try dropping some icons from the Workbench onto these icons.  Try 
  177. to figure out what is unusual about the image on the right (hint: it is a gadget)."
  178.             group HORIZ
  179.                 button ID ICN1 ICON '"muirexx:demos/icons/edit"',
  180.                     COMMAND '"string ID ISTR CONTENT edit %s"' PORT DEMO NODE '"button"',
  181.                     LABEL 'ascii'
  182.                 button ID ICN2 ICON '"muirexx:demos/icons/paint"',
  183.                     COMMAND '"string ID ISTR CONTENT view %s"' PORT DEMO NODE '"button"',
  184.                     LABEL 'picture'
  185.                 button ID ICN3 ICON '"muirexx:demos/icons/multiview"',
  186.                     COMMAND '"string ID ISTR CONTENT play %s"' PORT DEMO NODE '"button"',
  187.                     LABEL 'anim'
  188.                 button ID ICN4 ICON '"muirexx:demos/icons/help"',
  189.                     COMMAND '"string ID ISTR CONTENT %s"' PORT DEMO NODE '"button"',
  190.                     LABEL 'project'
  191.                 button ID ICN5 ICON '"muirexx:demos/icons/shell"',
  192.                     COMMAND '"string ID ISTR CONTENT execute %s"' PORT DEMO NODE '"button"',
  193.                     LABEL 'tool'
  194.                 space HORIZ
  195.                 button PICT '"muirexx:demos/muirexx.brush"' TRANS,
  196.                     ATTRS MUIA_Frame MUIV_Frame_None MUIA_Draggable TRUE,
  197.                     LABEL 'muirexx.brush'
  198.             endgroup
  199.             string ID ISTR
  200.         endgroup
  201.         group
  202.             view STRING "A demonstration of string gadgets. Try typing in some text 
  203. into the string gadget. Also select a file using the popasl gadget. Once some 
  204. lines have been added to the list try double clicking on one."
  205.             list ID SLST COMMAND '"string ID SSTR CONTENT %s"' PORT DEMO NODE '"list"'
  206.             group HORIZ
  207.                 group
  208.                     label DOUBLE "Entry:"
  209.                     label DOUBLE "File:"
  210.                 endgroup
  211.                 group
  212.                     string ID SSTR COMMAND '"list ID SLST INSERT STRING %s"' PORT DEMO NODE '"string"'
  213.                     popasl ID SASL COMMAND '"list ID SLST INSERT STRING %s"' PORT DEMO NODE '"popasl"'
  214.                 endgroup
  215.             endgroup
  216.         endgroup
  217.         group
  218.             view STRING "A simple demonstration of boopsi gadgets.  This demo 
  219. essentially duplicates the BoopsiDoor demo included with the MUI 
  220. distribution.  It illustrates use of boopsi gadgets in MUIRexx and also 
  221. shows an example of notification methods."
  222.             group HORIZ
  223.                 group
  224.                     label DOUBLE "Hue:"
  225.                     label DOUBLE "Saturation:"
  226.                 endgroup
  227.                 group
  228.                     gauge ID HUE ATTRS MUIA_Gauge_Max 16384,
  229.                                        MUIA_Gauge_Divide 262144,
  230.                                        MUIA_Gauge_Horiz TRUE
  231.                     gauge ID SAT ATTRS MUIA_Gauge_Max 16384,
  232.                                        MUIA_Gauge_Divide 262144,
  233.                                        MUIA_Gauge_Horiz TRUE
  234.                 endgroup
  235.             endgroup
  236.             object ID BOOP BOOPSI CLASS '"colorwheel.gadget"',
  237.                 ATTRS MUIA_Boopsi_MinWidth 30,
  238.                       MUIA_Boopsi_MinHeight 30,
  239.                       MUIA_Boopsi_Remember WHEEL_Hue,
  240.                       MUIA_Boopsi_Remember WHEEL_Saturation,
  241.                       MUIA_Boopsi_TagScreen WHEEL_Screen,
  242.                       WHEEL_Screen 0,
  243.                       WHEEL_Saturation 0,
  244.                       MUIA_FillArea TRUE
  245.         endgroup
  246.     endgroup
  247.     menu LABEL "Demo"
  248.         item COMMAND '"string ID STR CONTENT %s"' PORT DEMO LABEL "Menuitem 1"
  249.         item COMMAND '"string ID STR CONTENT %s"' PORT DEMO LABEL "Menuitem 2"
  250.         menu LABEL "Submenu"
  251.             item COMMAND '"string ID STR CONTENT %s"' PORT DEMO LABEL "Submenuitem 1"
  252.             item COMMAND '"string ID STR CONTENT %s"' PORT DEMO LABEL "Submenuitem 2"
  253.         endmenu
  254.     endmenu
  255. endwindow
  256.  
  257. method ID KNOB MUIM_Notify MUIA_Numeric_Value MUIV_EveryTime @METR 3 MUIM_Set MUIA_Numeric_Value MUIV_TriggerValue
  258. method ID KNOB MUIM_Notify MUIA_Numeric_Value MUIV_EveryTime @PSLD 3 MUIM_NoNotifySet MUIA_Numeric_Value MUIV_TriggerValue
  259. method ID PSLD MUIM_Notify MUIA_Numeric_Value MUIV_EveryTime @METR 3 MUIM_Set MUIA_Numeric_Value MUIV_TriggerValue
  260. method ID PSLD MUIM_Notify MUIA_Numeric_Value MUIV_EveryTime @KNOB 3 MUIM_NoNotifySet MUIA_Numeric_Value MUIV_TriggerValue
  261. method ID SLDR MUIM_Notify MUIA_Numeric_Value MUIV_EveryTime @GAUG 3 MUIM_Set MUIA_Gauge_Current MUIV_TriggerValue
  262.  
  263. method ID BOOP MUIM_Notify WHEEL_Hue MUIV_EveryTime @HUE 4 MUIM_Set MUIA_Gauge_Current MUIV_TriggerValue
  264. method ID BOOP MUIM_Notify WHEEL_Saturation MUIV_EveryTime @SAT 4 MUIM_Set MUIA_Gauge_Current MUIV_TriggerValue
  265.  
  266. callhook ID VIEW DROP COMMAND '"string ID FILE CONTENT view %s"' PORT DEMO
  267.  
  268. callhook ID ICN1 APP DROP COMMAND '"string ID ISTR CONTENT edit %s"' PORT DEMO
  269. callhook ID ICN2 APP DROP COMMAND '"string ID ISTR CONTENT view %s"' PORT DEMO
  270. callhook ID ICN3 APP DROP COMMAND '"string ID ISTR CONTENT play %s"' PORT DEMO
  271. callhook ID ICN4 APP DROP COMMAND '"string ID ISTR CONTENT %s"' PORT DEMO
  272. callhook ID ICN5 APP DROP COMMAND '"string ID ISTR CONTENT execute %s"' PORT DEMO
  273.  
  274. callhook ID DIR1 APP DROP COMMAND '"dirlist ID DIR1 PATH %s"' PORT DEMO
  275. callhook ID SLST APP COMMAND '"list ID SLST INSERT STRING %s"' PORT DEMO
  276.  
  277. exit
  278.